package com.cooljie.service;

import com.cooljie.dao.StudentCourseMapper;
import com.cooljie.entity.StudentCourse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by ACER on 2017/6/12.
 */
@Service("StudentCourseService")
public class StudentCourseServiceImpl implements StudentCourseService {
    @Autowired
    StudentCourseMapper studentCourseMapper;

    @Override
    public StudentCourse selectById(Integer id) {
        return studentCourseMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<StudentCourse> studentCourseList(Integer id) {
        return studentCourseMapper.selectStudentCourse(id);
    }

    @Override
    public int updateGrade(StudentCourse studentCourse) {
        return studentCourseMapper.updateByPrimaryKeySelective(studentCourse);
    }

    @Override
    public StudentCourse updateGrade(Integer id) {
        return studentCourseMapper.updateGrade(id);
    }

    @Override
    public int insertStudentCourse(StudentCourse studentCourse) {
        return studentCourseMapper.insertSelective(studentCourse);
    }

    @Override
    public void deleteByStudentId(Integer id) {
        studentCourseMapper.deleteByStudentId(id);
        return ;
    }


}
